package com.zan.pattern.factory.factory_method;

/**
 * @Author Zan
 * @Create 2024/4/24 20:48
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: Client
 */
public class Client {
    public static void main(String[] args) {
        // 创建咖啡店对象
        CoffeeStore store = new CoffeeStore();
        // 创建对象
//        AmericanCoffeeFactory factory = new AmericanCoffeeFactory();
        LatteCofferFactory factory = new LatteCofferFactory();
        store.setFactory(factory);
        // 点咖啡
        Coffee coffee = store.orderCoffee();
        System.out.println(coffee.getName());
    }
}
